<template>
  <el-dialog append-to-body :title="title" :visible="showImage" :before-close="close">
    <img width="100%" :src="imgUrl">
  </el-dialog>
</template>
<script>
export default {
  name: 'PreviewImg',
  components: {
  },
  props: {
    title: {
      type: String,
      default: '示例图片'
    },
    imgUrl: {
      type: String,
      default: ''
    },
    showImage: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
    }
  },

  methods: {

    // 关闭预览
    close() {
      this.$emit('update:showImage', false)
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
